package org.thread.test04.demo03;

/**
 *
 *  @author ZJL
 *  @date 2025-03-11
 */public class MyThread extends Thread {
     private String threadName;
     public MyThread(String threadName) {
         this.threadName = threadName;
     }
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            if (i % 10 == 0) {
                Thread.yield();
            }
            System.out.println(this.threadName+": " + i);
        }
    }
}
